;; Trigonometric functions

(in-package :azala)

(defmethod diff-unary ((operator (eql 'sin)) x dx)
  `(* (cos ,x) ,(diff x dx)))

(defmethod diff-unary ((operator (eql 'cos)) x dx)
  `(* (sin ,x) (* -1 ,(diff x dx))))

;(defconstant +sin-table+ '((0 0)
;			   (/ pi 3)))

;; sin(0), cos(0), and tan(0)

(defmethod simplify-unary ((operator (eql 'sin)) (x (eql 0)))
  (declare (ignore operator x))
  0)

(defmethod simplify-unary ((operator (eql 'cos)) (x (eql 0)))
  (declare (ignore operator x))
  1)

(defmethod simplify-unary ((operator (eql 'tan)) (x (eql 0)))
  (declare (ignore operator x))
  0)